home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1992 September
/
1992-09.d64
/
smart format
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
3KB
|
79 lines
0 clr
100 rem 'smart format v1.0' by rustin ambrose 1992
110 :
120 rem ** a$ must be first variable used in program **
130 a$="":c0$=chr$(0):cr$=chr$(13):va=peek(45)+256*peek(46)
140 poke(va+2),255:poke(va+3),0:poke(va+4),192
150 print"--setting up. . ."
160 forad=49176to49375:readx:pokead,x:nextad
170 poke53280,0:poke53281,0
180 print"[147][155]";chr$(14)
190 print"***********[211][205][193][210][212][160][198][207][210][205][193][212] [214]1.0***********"
200 printcr$spc(11)"1541 fast format"cr$spc(12)"without 'bump'"
210 printcr$spc(11)"by [210]ustin [193]mbrose"
220 print"[197][206][212][197][210]: diskette name,id"
230 print"(name can have max of 16 chars,"
240 print" i.d. must be 2 chars long)";cr$
250 dn$="":id$="":inputdn$,id$:if(dn$="")or(id$="")thenend
260 ln=len(dn$):ifln>16thenprintcr$"--name too long.":goto220
270 iflen(id$)<>2thenprintcr$"--i.d. not 2 characters long.":goto220
280 cs$="n0:"+dn$+chr$(44)+id$+chr$(13):cl=len(cs$):poke49175,cl
290 fori1=1tocl:poke49151+i1,asc(mid$(cs$,i1,1)+c0$):nexti1
300 :
310 close15:open15,8,15
320 print#15,"m-r"chr$(34);c0$:get#15,t$:ifasc(t$+c0$)then380
330 printcr$"**[201]nternal track counter of drive needs"
340 print" to be initialized."
350 print" [208]lease insert [193][206][217] formatted diskette."
360 print" [212]he diskette will not be affected**":gosub630
370 print#15,"i0":gosub700:goto320
380 printcr$"**[208]lace diskette to be formatted into"
390 print" drive**":gosub630
400 print#15,"m-r"chr$(30);c0$:get#15,wp$:ifasc(wp$+c0$)and16then430
410 printcr$"--write protect is on."
420 print"--replace diskette.":gosub630:goto400
430 printcr$"**[208]lease re-check that diskette in"
440 print" drive should be formatted."
450 print" [193]ll data will be destroyed!**"
460 printcr$spc(7)"[[200][201][212] [211][208][193][195][197] [194][193][210] [212][207] [198][207][210][205][193][212]":gosub640
470 print#15,"m-r"chr$(34);c0$:get#15,t$:ifasc(t$+c0$)=0then330
480 print#15,"m-r"chr$(30);c0$:get#15,wp$:if(asc(wp$+c0$)and16)=0then410
490 printcr$"--formatting '"dn$","id$"' . . ."
500 print#15,"m-w"chr$(28);c0$;chr$(1);c0$
510 open2,8,2,"#1":print#15,"b-p";2;0:print#2,a$;:close2
520 print#15,"m-e"chr$(28);chr$(4):gosub700
530 printcr$"--done. [i.s. gaps: ";
540 print#15,"m-r"chr$(5)chr$(6)chr$(4)
550 fori1=0to3:get#15,g$:g(i1)=asc(g$+c0$):nexti1
560 fori1=3to0step-1:printg(i1);:nexti1:print"]"
570 printspc(10)"[# of re-tries:";
580 print#15,"m-r"chr$(32)chr$(6):get#15,er$:er=asc(er$+c0$)
590 print10-er"]"
600 close15:printcr$"**[198]ormat another?**":gosub630:goto220
610 :
620 :
630 printcr$spc(7)"[[200][201][212] [211][208][193][195][197] [194][193][210] [212][207] [195][207][206][212][201][206][213][197]"
640 printspc(11)"[207][210] '[197]' [212][207] [197][216][201][212]]"
650 poke198,0
660 geti$:ifi$="e"thenclose15:end
670 ifi$<>" "then660
680 return
690 :
700 input#15,e1$,e2$,e3$,e4$:ife1$="00"thenreturn
710 printcr$"[196][210][201][214][197] [197][210][210][207][210] #"e1$":"
720 print"'"e2$"' [212][210][193][195][203]#"e3$" [211][197][195][212][207][210]#"e4$:close15:end
730 :
740 data1,4,10,0,174,23,4,134,163,189,255,3,157,255,1,202
750 data208,247,160,70,162,193,169,132,32,93,4,32,48,6,160,13
760 data162,238,169,61,32,93,4,32,48,6,160,54,162,252,169,174
770 data32,93,4,169,76,141,0,6,169,123,141,1,6,169,4,32
780 data210,200,76,64,238,140,105,4,142,106,4,141,3,6,162,0
790 data189,255,255,157,48,6,232,200,204,3,6,208,243,169,96,157
800 data48,6,96,165,81,16,19,169,6,141,33,6,169,15,141,34
810 data6,169,10,141,32,6,169,1,133,81,160,0,209,50,240,13
820 data201,2,208,6,174,38,6,142,4,6,76,251,250,201,1,240
830 data52,165,68,74,74,74,74,74,170,189,24,4,24,109,4,6
840 data157,5,6,141,38,6,32,48,6,173,12,28,41,31,9,192
850 data141,12,28,169,255,141,3,28,169,85,141,1,28,162,2,32
860 data36,254,76,177,252,76,0,251